package com.forekenow.work0723;

import java.awt.*;

public class Point {
    private int x;

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    private int y;

    public Point(int x0, int y0) {
        this.x = x0;
        this.y = y0;
    }

    public Point() {
        this.x = 5;
        this.y = 5;
    }




    public void movePoint(int dx,int dy){
        this.x += dx;
        this.y += dy;
    }

    public static void main(String[] args) {
        Point p1 = new Point();
        Point p2 = new Point(15,25);
        p1.movePoint(15,15);
        System.out.printf("p1的坐标5为(%d,%d)\n",p1.getX(),p1.getY());
        p2.movePoint(2,2);
        System.out.printf("p2的坐标为(%d,%d)\n",p2.getX(),p2.getY());
    }
}
